package com.dd.seckill.cluster.controller;

import com.dd.seckill.cluster.pojo.DO.SeckillGoods;
import com.dd.seckill.cluster.pojo.response.ApiResponse;
import com.dd.seckill.cluster.service.internal.impl.SeckillGoodsServiceImpl;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @Author liuxianmeng
 * @CreateTime 2025/9/15 11:57
 * @Description 秒杀商品控制器
 */
@Slf4j
@RestController
@RequestMapping("/seckill-goods")
@RequiredArgsConstructor
@Api(tags = "秒杀商品控制器")
public class SeckillGoodsController {

    private final SeckillGoodsServiceImpl seckillGoodsServiceImpl;

    @GetMapping("/list")
    @ApiOperation("查询所有秒杀商品信息")
    public ApiResponse<List<SeckillGoods>> list(){
        log.info("C SeckillController M list()..");
        List<SeckillGoods> seckillGoods = seckillGoodsServiceImpl.seckillGoodsList();
        return ApiResponse.success(seckillGoods);
    }
}
